#!/usr/bin/node

const Readable = require('stream').Readable;

let rs = new Readable(),
    c  = 'a'.charCodeAt(0);//转成ASCII码


class MyReadable extends Readable{
  constructor(){
    super();
  }
  _read() {
    rs.push(String.fromCharCode(c++));
    if(c>'z'.charCodeAt){
      rs.push(null);
    }
  }
}

let mr = new MyReadable();
console.log(mr);
rs.pipe(process.stdout);



